package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Name     string `gorm:"type:varchar(30)" json:"name"`
	Password string `gorm:"type:varchar(225)" json:"password"`
	Apass    string `gorm:"type:varchar(225)" json:"apass"`
}
type Dy struct {
	gorm.Model
	Title     string `gorm:"type:varchar(30)" json:"title"`
	Content   string `gorm:"type:varchar(30)" json:"content"`
	Img       string `gorm:"type:varchar(225)" json:"img"`
	LikeCount int    `gorm:"type:int" json:"like_count"`
}
type Like struct {
	gorm.Model
	UserId int  `gorm:"type:int" json:"user_id"`
	User   User `gorm:"foreignKey:UserId" json:"user"`
	DyId   int  `gorm:"type:int" json:"dy_id"`
	Dy     Dy   `gorm:"foreignKey" json:"dy"`
}
